package com.zulin.utils;

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class StringUtils {
	
	public Date toDate(String string) throws ParseException{
		Date date = null;
		SimpleDateFormat sdf1 = new SimpleDateFormat("MM/dd/yyyy hh:mm");  
		date = sdf1.parse(string); 
		
		DateFormat format = new SimpleDateFormat("yyyy-MM-dd hh:mm"); 
		String str = format.format(date);
		SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy-MM-dd hh:mm");  
		
		Date dateString = sdf2.parse(str);
		System.out.println("dateString"+dateString);
		return dateString;
	}
	
}
